home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
UTILITY
/
BF202A.ARJ
/
BNFAPI.DOC
< prev
next >
Wrap
Text File
|
1991-11-26
|
10KB
|
256 lines
Back & Forth Professional API for upcoming release of v2.00
Back & Forth Professional versions 1.25 and later are fully compatible
with the DOS 5 API task switcher standard as documented in the Microsoft
DOS 5 technical reference manual. Please consult it for further information/
examples.
Back & Forth Professional also supplies a set of API calls for further
control of its environment. All Back & Forth Professional API calls
originate through interrupt 12h. To initiate an API call, the registers
should be filled as follows:
AX = 0fffeh
CX = 0fffeh
BX = function #
DX, ES, and DI may also be needed depending on function call.
Back & Forth Professional API Calls
Function #: 0 -- B&F Pro installed request.
Parameters: AX = 0ffffe
CX = 0ffffe
BX = 0
Returned : AX = 1 if B&F Pro installed
────────────────────────────────────────────────────────────────────────────
Function #: 1 -- Reserved.
────────────────────────────────────────────────────────────────────────────
Function #: 2 -- Get memory stats.
Parameters: AX = 0ffffe
CX = 0ffffe
BX = 2
Returned : AX = amount of available swap memory in kilobytes.
BX = maximum task size in kilobytes.
DX = fixed overhead per task.
** NOTE ** Fixed overhead does NOT include video saving/restoring, program
code/data, or macro memory if macros are enabled in EMS memory.
────────────────────────────────────────────────────────────────────────────
Function #: 3 -- Switch task by ID value
Parameters: AX = 0ffffe
CX = 0ffffe
BX = 3
DX = Task ID value (see function 7 for makeup of ID)
Returned : AX = 1 task switch will occur as soon as DOS is safe
AX = 0 invalid task ID.
────────────────────────────────────────────────────────────────────────────
Function #: 4 -- Reserved.
────────────────────────────────────────────────────────────────────────────
Function #: 5 -- Reserved.
────────────────────────────────────────────────────────────────────────────
Function #: 6 -- B&F Pro version #
Parameters: AX = 0ffffe
CX = 0ffffe
BX = 6
Returned : AX = version #
Major version # = AX / 100
Minor version # = AX % 100
────────────────────────────────────────────────────────────────────────────
Function #: 7 -- Spawn a program. BF_SPAWN record is passed in ES:DI
Parameters: AX = 0ffffe
CX = 0ffffe
BX = 7
ES = segment of BF_SPAWN record
DI = offset of BF_SPAWN record
Returned : AX = 1 spawn will take place when it is safe
AX = 0 no task handles available!
────────────────────────────────────────────────────────────────────────────
Function #: 8 -- Get active task list.
Parameters: AX = 0ffffe
CX = 0ffffe
BX = 8
ES = segment of task storage area
DI = offset of task storage area
Returned : AX = # of tasks loaded
** NOTES ** The STORAGE AREA must be at least sizeof(BF_TASK) * 21 or you
will have serious problems on your hand!
See OEMTEST.C for a complete example of this function.
────────────────────────────────────────────────────────────────────────────
Function #: 9 -- Reserved.
────────────────────────────────────────────────────────────────────────────
Function #: 10 -- Return active clipboard filename.
Parameters: AX = 0ffffe
CX = 0ffffe
BX = 10
Returned : DX:AX makes up a far ptr to a '\0' terminated filename.
** NOTE ** The cut/paste file is NOT in ASCII format... the next release
of this document will have sample code to read/write B&F Pro
clipboard files.
────────────────────────────────────────────────────────────────────────────
Function #: 11 -- Get active task #.
Parameters: AX = 0ffffe
CX = 0ffffe
BX = 11
Returned : AX = Active task # in range of 0 to 19. Information about the
task can be obtained by using this value as an offset into
the active task list (See function 8).
BX = # of tasks allocated
DX = Max # of tasks
────────────────────────────────────────────────────────────────────────────
Function #: 12 -- Reserved.
────────────────────────────────────────────────────────────────────────────
Function #: 13 -- Reserved.
────────────────────────────────────────────────────────────────────────────
Function #: 14 -- Reserved.
────────────────────────────────────────────────────────────────────────────
Function #: 15 -- Put a '\0' terminated string of characters into the
B&F Pro's internal keyboard buffer.
Parameters: AX = 0ffffe
CX = 0ffffe
BX = 15
ES = segment of string
DI = offset of string
Returned : Nothing.
────────────────────────────────────────────────────────────────────────────
Function #: 16 -- Is current video mode a text mode
Parameters: AX = 0ffffe
CX = 0ffffe
BX = 16
Returned : AX = -1 Graphics mode
AX = 0 Color text mode
AX = 4 Mono text mode
────────────────────────────────────────────────────────────────────────────
Function #: 17 -- B&F Pro user #
Parameters: AX = 0ffffe
CX = 0ffffe
BX = 17
Returned : AX = user # from 0 to 255
────────────────────────────────────────────────────────────────────────────
Function #: 18 -- Switch task by task_no into active task list
Parameters: AX = 0ffffe
CX = 0ffffe
BX = 18
DX = Task # (see function 8 for obtaining active task list)
Returned : AX = 1 task switch will occur as soon as DOS is safe
AX = 0 an attempt was made to switch to the active task!
AX = -1 the task # was invalid
────────────────────────────────────────────────────────────────────────────
Function #: 19 -- Delete task.
Parameters: AX = 0ffffe
CX = 0ffffe
BX = 18
DX = Task # (see function 8 for obtaining active task list)
Returned : AX = 1 task was deleted successfully.
AX = 0 an attempt was made to delete the active task!
AX = -1 the task # was invalid
** Note ** If you delete a task that was lower in the task list than the
active task, the active task # will change! Use function call
11 to regain active task #.
────────────────────────────────────────────────────────────────────────────
Function #: 20 -- Get next available task handle
Parameters: AX = 0ffffe
CX = 0ffffe
BX = 20
Returned : AX = 1 to xx next available task handle
AX = -1 task table is full.
** NOTE ** This function can be used to build a hot key, etc. If a task
is NOT spawned immediately after this call, the task handle #
returned may become invalid.
Back & Forth Professional API Data Structures
1) BF_SPAWN record used in function 7.
typedef struct
{
char description[21]; /* Task description */
char disable_hot_keys; /* On/off - some applications can't afford*/
int environment_size; /* to be bothered. */
/* Size of environment in bytes. */
char kb_flags; /* Hotkey kbflags ALT,LSHIFT,RSHIFT,CTRL */
int key_code; /* Key code as retrieved at the int 9h */
/* level. */
int max_ems_pages; /* Not implemented in OEM versions of */
/* kernel. */
int memory_needed; /* Needed memory in K. */
char program_id[3]; /* Two letter Desqview style ID */
char program_name[13]; /* Name of program without path. EXE,COM, */
/* or BAT extension must be supplied or */
/* program won't run! */
char program_path[66]; /* Directory where program can be found. */
char work_path[66]; /* Initial path to start program in. If */
/* not specified, work path will be set */
/* to the program path. */
} BF_SPAWN;
2) BF_TASK record used in function 8.
typedef struct /* Record B&F passes back about live tasks*/
{
time_t actual_start_time; /* Actual start time of program */
char description[21]; /* Task description */
time_t elapsed_time; /* Actual time spent in task */
int id; /* Task id */
char kb_flags; /* Keyboard flags component of task hotkey*/
int key_code; /* Keyboard code component of task hotkey */
time_t stop_time; /* Time task was suspended/exited */
int task_handle_no; /* B&F assigned task handle.. used to */
/* individual tasks! */
} BF_TASK;